import { COLUMNS_WIDTH } from '@/utils/common'
import { formatTime } from '@/utils/format'

export const COLUMNS = [
    {
        title: '#',
        dataIndex: 'id',
        key: 'id',
        width: COLUMNS_WIDTH.id
    },
    {
        title: '产品名',
        dataIndex: 'productName',
        key: 'productName'
    },
    {
        title: '产地名',
        dataIndex: 'countyName',
        key: 'countyName'
    },
    {
        title: '图片',
        dataIndex: 'imageUrl',
        key: 'imageUrl'
    },
    {
        title: '创建时间',
        dataIndex: 'createdTime',
        key: 'createdTime',
        width: COLUMNS_WIDTH.wdDate,
        customRender: (value: any) => {
            return formatTime(value.text, 'YYYY-MM-DD HH:mm:ss')
        }
    },
    {
        title: '更新时间',
        dataIndex: 'updatedTime',
        key: 'updatedTime',
        width: COLUMNS_WIDTH.wdDate,
        customRender: (value: any) => {
            return formatTime(value.text, 'YYYY-MM-DD HH:mm:ss')
        }
    },
    {
        title: '操作',
        dataIndex: 'action',
        key: 'action',
        width: COLUMNS_WIDTH.wdBtn,
        fixed: 'right'
    }
]
